<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function giao(m,n) {
            var b =m
        
        for (i = 0 ;i <= n-1; i++) {
            for (j = 0;j<= n-i-1;j++) {
                if (b[j]<b[j+1]) {
                    var a = b[j]
                        b[j] = b[j+1]
                        b[j+1] = a
                }
            }
        }
        console.log(b);
        }

        
        giao([9,8,7,6,5,4,3,2,1,],9)
    </script>
</body>
</html>